home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / C Internet Config / Examples ƒ / ICHelloCruelWorld / IC Headers ƒ / IC Component API Descriptions.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-17  |  22.2 KB  |  370 lines  |  [TEXT/SPM ]

  1. /*
  2.     Component Interface.h
  3.     
  4.     Describes the component interface routines and their parameters.
  5.     
  6.     Important note about naming conventions:  Read the file "API Readme.h" to understand
  7.     the prefixes used in all of the calls...
  8. */
  9.  
  10. #if 0 // don't include into compilation of code
  11.  
  12. /* ***** Starting Up and Shutting Down ***** */
  13.  
  14. pascal ICError ICCStart(internetConfigurationComponent *inst, OSType creator);
  15. /*
  16.     Call this at application initialisation. Set creator to your application
  17.     creator to allow for future expansion of the IC system. Returns
  18.     inst as a connection to the IC system.
  19. */
  20.  
  21. pascal ICError ICCStop(internetConfigurationComponent inst);
  22. /*
  23.     It is illegal to call this routine inside a ICBegin/End pair.
  24.     
  25.     Call this at application initialisation, after which inst
  26.     is no longer valid connection to IC.
  27. */
  28.  
  29. /* ***** Specifying a Configuration ***** */
  30.  
  31. pascal ICError ICCFindConfigFile(internetConfigurationComponent inst, short count, ICDirSpecArrayPtr folders);
  32. /*
  33.     It is illegal to call this routine inside a ICBegin/End pair.
  34.     
  35.     Call to configure this connection to IC.
  36.     Set count as the number of valid elements in folders.
  37.     Set folders to a pointer to the folders to search.
  38.     Setting count to 0 and folders to nil is OK.
  39.     Searches the specified folders and then the Preferences folder
  40.     in a unspecified manner.
  41. */
  42.  
  43. pascal ICError ICCFindUserConfigFile(internetConfigurationComponent inst, ICDirSpec *where)
  44. /*
  45.     Requires IC 1.1.
  46.     
  47.     It is illegal to call this routine inside a ICBegin/End pair.
  48.     
  49.     Similar to ICFindConfigFile except that it only searches the folder
  50.     specified in where.  If the input parameters are valid the routine
  51.     will always successful configure the instance, creating an
  52.     empty configuration if necessary
  53.     For use with double-clickable preference files.
  54. */
  55.  
  56. pascal ICError ICCGeneralFindConfigFile(internetConfigurationComponent inst, Boolean search_prefs, Boolean can_create,
  57.         short count, ICDirSpecArrayPtr folders)
  58. /*
  59.     Requires IC 1.2.
  60.     
  61.     It is illegal to call this routine inside a ICBegin/End pair.
  62.     
  63.     Call to configure this connection to IC.
  64.     This routine acts as a more general replacement for
  65.     ICFindConfigFile and ICFindUserConfigFile.
  66.     Set search_prefs to true if you want it to search the preferences folder.
  67.     Set can_create to true if you want it to be able to create a new config.
  68.     Set count as the number of valid elements in folders.
  69.     Set folders to a pointer to the folders to search.
  70.     Setting count to 0 and folders to nil is OK.
  71.     Searches the specified folders and then optionally the Preferences folder
  72.     in a unspecified manner.
  73. */
  74.  
  75. pascal ICError ICCChooseConfig(internetConfigurationComponent inst)
  76. /*
  77.     Requires IC 1.2.
  78.     
  79.     It is illegal to call this routine inside a ICBegin/End pair.
  80.     
  81.     Requests the user to choose a configuration, typically using some
  82.     sort of modal dialog. If the user cancels the dialog the configuration
  83.     state will be unaffected.
  84. */
  85.  
  86. pascal ICError ICCChooseNewConfig(internetConfigurationComponent inst)
  87. /*
  88.     Requires IC 1.2.
  89.     
  90.     It is illegal to call this routine inside a ICBegin/End pair.
  91.     
  92.     Requests the user to create a new configuration, typically using some
  93.     sort of modal dialog. If the user cancels the dialog the configuration
  94.     state will be unaffected.
  95. */
  96.  
  97. pascal ICError ICCGetConfigName(internetConfigurationComponent inst, Boolean longname, Str255 name)
  98. /*
  99.     Requires IC 1.2.
  100.     
  101.     You must specify a configuration before calling this routine.
  102.     Returns a string that describes the current configuration at a user
  103.     level. Set longname to true if you want a long name, up to 255
  104.     characters, or false if you want a short name, typically about 32
  105.     characters.
  106.     The returned string is for user display only. If you rely on the
  107.     exact format of it, you will conflict with any future IC
  108.     implementation that doesn't use explicit preference files.
  109. */
  110.  
  111. pascal ICError ICCGetConfigReference(internetConfigurationComponent inst, ICConfigRefHandle ref)
  112. /*
  113.     Requires IC 1.2.
  114.     
  115.     You must specify a configuration before calling this routine.
  116.     Returns a self-contained reference to the instance's current
  117.     configuration.
  118.     ref must be a valid non-nil handle and it will be resized to fit the
  119.     resulting data.
  120. */
  121.  
  122. pascal ICError ICCSetConfigReference(internetConfigurationComponent inst, ICConfigRefHandle ref, long flags)
  123. /*
  124.     Requires IC 1.2.
  125.     
  126.     It is illegal to call this routine inside a ICBegin/End pair.
  127.     
  128.     Reconfigures the instance using a configuration reference that was
  129.     got using ICGetConfigReference reference. Set the
  130.     icNoUserInteraction_bit in flags if you require that this routine
  131.     not present a modal dialog. Other flag bits are reserved and should
  132.     be set to zero.
  133.     ref must not be nil.
  134. */
  135.  
  136. pascal ICError ICCSpecifyConfigFile(internetConfigurationComponent inst, FSSpec *config)
  137. /*
  138.     It is illegal to call this routine inside a ICBegin/End pair.
  139.     
  140.     For use only by the IC application.
  141.     If you call this routine yourself, you will conflict with any
  142.     future IC implementation that doesn't use explicit preference files.
  143. */
  144.  
  145. /* ***** Getting Information ***** */
  146.  
  147. pascal ICError ICCGetSeed(internetConfigurationComponent inst, on, as started by ICBegin.
  148.     You must have called ICBegin before calling this routine.
  149. */
  150.  
  151. /* ***** User Interface Stuff ***** */
  152.  
  153. pascal ICError ICCEditPreferences(internetConfigurationComponent inst, ConstStr255Param key)
  154. /*
  155.     Requires IC 1.1.
  156.     
  157.     You must specify a configuration before calling this routine.
  158.     You do not have to be inside an ICBegin/End pair to call this routine.
  159.     Instructs IC to display the user interface associated with editing
  160.     preferences and focusing on the preference specified by key.
  161.     If key is the empty string then no preference should be focused upon.
  162.     You must have specified a configuration before calling this routine.
  163.     You do not need to call ICBegin before calling this routine.
  164.     In the current implementation this launches the IC application
  165.     (or brings it to the front) and displays the window containing
  166.     the preference specified by key.
  167.     It may have a radically different implementation in future
  168.     IC systems.
  169. */
  170.  
  171. /* ***** URL Handling ***** */
  172.  
  173. pascal ICError ICCParseURL(internetConfigurationComponent inst, ConstStr255Param hint, Ptr data, long len,
  174.         long *selStart, long *selEnd, Handle url)
  175. /*
  176.     Requires IC 1.1.
  177.     
  178.     You must specify a configuration before calling this routine.
  179.     You do not have to be inside an ICBegin/End pair to call this routine.
  180.     Parses a URL out of the specified text and returns it in a canonical form
  181.     in a handle.
  182.     hint indicates the default scheme for URLs of the form "name@address".
  183.     If hint is the empty string then URLs of that form are not allowed.
  184.     data points to the start of the text. It must not be nil.
  185.     len indicates the length of the text. It must be non-negative.
  186.     selStart and selEnd should be passed in as the current selection of
  187.     the text. This selection is given in the same manner as TextEdit,
  188.     ie if selStart = selEnd then there is no selection only an insertion
  189.     point. Also selStart ≤ selEnd and 0 ≤ selStart ≤ len and 0 ≤ selEnd ≤ len.
  190.     selStart and selEnd are returned as the bounds of the URL. If the
  191.     routine returns an error then these new boundaries may be
  192.     invalid but they will be close.
  193.     The incoming url handle must not be nil.  The resulting URL is normalised
  194.     and copied into the url handle, which is resized to fit.
  195. */
  196.  
  197. pascal ICError ICCLaunchURL(internetConfigurationComponent inst, ConstStr255Param hint, Ptr data, long len,
  198.         long *selStart, long *selEnd)
  199. /*
  200.     Requires IC 1.1.
  201.     
  202.     You must specify a configuration before calling this routine.
  203.     You do not have to be inside an ICBegin/End pair to call this routine.
  204.     Parses a URL out of the specified text and feeds it off to the
  205.     appropriate helper.
  206.     hint indicates the default scheme for URLs of the form "name@address".
  207.     If hint is the empty string then URLs of that form are not allowed.
  208.     data points to the start of the text. It must not be nil.
  209.     len indicates the length of the text. It must be non-negative.
  210.     selStart and selEnd should be passed in as the current selection of
  211.     the text. This selection is given in the same manner as TextEdit,
  212.     ie if selStart = selEnd then there is no selection only an insertion
  213.     point. Also selStart ≤ selEnd and 0 ≤ selStart ≤ len and 0 ≤ selEnd ≤ len.
  214.     selStart and selEnd are returned as the bounds of the URL. If the
  215.     routine returns an error then these new boundaries may be
  216.     invalid but they will be close.
  217.     The URL is parsed out of the text and passed off to the appropriate
  218.     helper using the GURL AppleEvent.
  219. */
  220.  
  221. /* ***** Mappings Routines *****
  222.  * 
  223.  * Routines for interrogating mappings database.
  224.  * 
  225.  * ----- High Level Routines -----
  226.  */
  227.  
  228. pascal ICError ICCMapFilename(internetConfigurationComponent inst, ConstStr255Param filename, ICMapEntry *entry)
  229. /*
  230.     Requires IC 1.1.
  231.     
  232.     You must specify a configuration before calling this routine.
  233.     If you are getting or setting multiple preferences, you should place
  234.     these calls within an ICBegin/ICEnd pair.
  235.     If you call this routine outside of such a pair, it implicitly
  236.     calls ICBegin(inst, icReadWritePerm).
  237.     Takes the name of an incoming file and returns the most appropriate
  238.     mappings database entry, based on its extension.
  239.     filename must not be the empty string.
  240.     Returns icPrefNotFoundErr if no suitable entry is found.
  241. */
  242.  
  243. pascal ICError ICCMapTypeCreator(internetConfigurationComponent inst, OSType fType, OSType fCreator,
  244.         ConstStr255Param filename, ICMapEntry *entry)
  245. /*
  246.     Requires IC 1.1.
  247.     
  248.     You must specify a configuration before calling this routine.
  249.     You must be inside an ICBegin/End pair to call this routine.
  250.     Takes the type and creator (and optionally the name) of an outgoing
  251.     file and returns the most appropriate mappings database entry.
  252.     The filename may be either the name of the outgoing file or
  253.     the empty string.
  254.     Returns icPrefNotFoundErr if no suitable entry found.
  255. */
  256.  
  257. /* ----- Mid Level Routines ----- */
  258.  
  259. pascal ICError ICCMapEntriesFilename(internetConfigurationComponent inst, Handle entries, ConstStr255Param filename,
  260.         ICMapEntry *entry)
  261. /*
  262.     Requires IC 1.1.
  263.     
  264.     You must specify a configuration before calling this routine.
  265.     You do not have to be inside an ICBegin/End pair to call this routine.
  266.     Takes the name of an incoming file and returns the most appropriate
  267.     mappings database entry, based on its extension.
  268.     entries must be a handle to a valid IC mappings database preference.
  269.     filename must not be the empty string.
  270.     Returns icPrefNotFoundErr if no suitable entry is found.
  271. */
  272.  
  273. pascal ICError ICCMapEntriesTypeCreator(internetConfigurationComponent inst, Handle entries, OSType fType, OSType fCreator,
  274.         ConstStr255Param filename, ICMapEntry *entry)
  275. /*
  276.     Requires IC 1.1.
  277.     
  278.     You must specify a configuration before calling this routine.
  279.     You do not have to be inside an ICBegin/End pair to call this routine.
  280.     Takes the type and creator (and optionally the name) of an outgoing
  281.     file and returns the most appropriate mappings database entry.
  282.     entries must be a handle to a valid IC mappings database preference.
  283.     The filename may be either the name of the outgoing file or
  284.     the empty string.
  285.     Returns icPrefNotFoundErr if no suitable entry found.
  286. */
  287.  
  288. /* ----- Low Level Routines ----- */
  289.  
  290. pascal ICError ICCCountMapEntries(internetConfigurationComponent inst, Handle entries, long *count)
  291. /*
  292.     Requires IC 1.1.
  293.     
  294.     You must specify a configuration before calling this routine.
  295.     You do not have to be inside an ICBegin/End pair to call this routine.
  296.     Counts the number of entries in the mappings database.
  297.     entries must be a handle to a valid IC mappings database preference.
  298.     count is set to the number of entries.
  299. */
  300.  
  301. pascal ICError ICCGetIndMapEntry(internetConfigurationComponent inst, Handle entries, long ndx, long *pos, ICMapEntry *entry)
  302. /*
  303.     Requires IC 1.1.
  304.     
  305.     You must specify a configuration before calling this routine.
  306.     You do not have to be inside an ICBegin/End pair to call this routine.
  307.     Gets the ndx'th entry in the mappings database.
  308.     entries must be a handle to a valid IC mappings database preference.
  309.     ndx must be in the range from 1 to the number of entries in the database.
  310.     The value of pos is ignored on input. pos is set to the position of
  311.     the ndx'th entry in the database and is suitable for passing back
  312.     into ICSetMapEntry.
  313.     Does not return any user data associated with the entry.
  314. */
  315.  
  316. pascal ICError ICCGetMapEntry(internetConfigurationComponent inst, Handle entries, long pos, ICMapEntry *entry)
  317. /*
  318.     Requires IC 1.1.
  319.     
  320.     You must specify a configuration before calling this routine.
  321.     You do not have to be inside an ICBegin/End pair to call this routine.
  322.     Returns the entry located at position pos in the mappings database.
  323.     entries must be a handle to a valid IC mappings database preference.
  324.     pos should be 0 to get the first entry. To get the subsequent entries, add
  325.     entry.total_size to pos and iterate.
  326.     Does not return any user data associated with the entry.
  327. */
  328.  
  329. pascal ICError ICCSetMapEntry(internetConfigurationComponent inst, Handle entries, long pos, ICMapEntry *entry)
  330. /*
  331.     Requires IC 1.1.
  332.     
  333.     You must specify a configuration before calling this routine.
  334.     You do not have to be inside an ICBegin/End pair to call this routine.
  335.     Sets the entry located at position pos in the mappings database.
  336.     entries must be a handle to a valid IC mappings database preference.
  337.     pos should be either a value returned from ICGetIndMapEntry or a value
  338.     calculated using ICGetMapEntry.
  339.     entry is a var parameter purely for stack space reasons. It is not
  340.     modified in any way.
  341.     Any user data associated with the entry is unmodified.
  342. */
  343.  
  344. pascal ICError ICCDeleteMapEntry(internetConfigurationComponent inst, Handle entries, long pos)
  345. /*
  346.     Requires IC 1.1.
  347.     
  348.     You must specify a configuration before calling this routine.
  349.     You do not have to be inside an ICBegin/End pair to call this routine.
  350.     Deletes the mappings database entry at pos.
  351.     entries must be a handle to a valid IC mappings database preference.
  352.     pos should be either a value returned from ICGetIndMapEntry or a value
  353.     calculated using ICGetMapEntry.
  354.     Also deletes any user data associated with the entry.
  355. */
  356.  
  357. pascal ICError ICCAddMapEntry(internetConfigurationComponent inst, Handle entries, ICMapEntry *entry)
  358. /*
  359.     Requires IC 1.1.
  360.     
  361.     You must specify a configuration before calling this routine.
  362.     You do not have to be inside an ICBegin/End pair to call this routine.
  363.     Adds an entry to the mappings database.
  364.     entries must be a handle to a valid IC mappings database preference.
  365.     The entry is added to the end of the entries database.
  366.     No user data is added.
  367. */
  368.  
  369. #endif
  370.